<%@ page import="org.gnomus.server.Context" %>
<%@ page import="org.gnomus.data.assignment" %>
<%@ page import="java.util.List" %>
<%@ page import="org.gnomus.data.member" %>
<%@ page import="org.gnomus.data.access" %>
<%@ page import="org.gnomus.server.C" %>
<%
  Context ctx = Context.get();
  assignment ant = (assignment) ctx.data.get("assignment");
  String lab = (String) ant.get("lab");
  List<member> mbrs = ant.getMembers();
%>
<h3 style="margin:8px 0">
  <%= C.assignments.get(lab) %> Lab
</h3>
<table style="width:100%;">
  <tr>
    <td>Member name</td>
    <td>Access code</td>
    <td class="a-center">Access code used?</td>
    <td class="a-center">Assignment complete?</td>
    <td class="a-center">Score</td>
  </tr>
  <%
    for (member mbr : mbrs) {
      if (Boolean.FALSE.equals(mbr.isActive())) {
        continue;
      }
      access acs = (access) mbr.get("access");
  %>
  <tr>
    <td><%= mbr.getFirstName() %> <%= mbr.getLastName() %></td>
    <td><%= acs.get("code") %></td>
    <td class="a-center"><%= acs.getUsed() ? "yes" : "not yet" %></td>
    <td class="a-center"><%= acs.getCompleted() ? "yes" : "not yet" %></td>
    <td class="a-center"><%= acs.getScore() %></td>
  </tr>
  <%
    }
  %>
</table>